<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改教务班级')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-classes-edit" th:object="${teachingClasses}">
            <input name="classId" th:field="*{classId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">班级名：</label>
                <div class="col-sm-7">
                    <input name="className" th:field="*{className}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">满班人数：</label>
                <div class="col-sm-2" style="width: 70px">
                    <input name="maxStudent" th:field="*{maxStudent}" class="form-control" type="number" style="width: 50px" min="1">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">每天上课：</label>
                <label class="col-sm-1 control-label" style="width: 82px">学生消耗</label>
                <div class="col-sm-1" style="width: 70px; padding: inherit">
                    <input name="studentConsume" th:field="*{studentConsume}" class="form-control" type="number" style="width: 50px" min="1">
                </div>
                <label class="control-label">课时</label>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"> </label>
                <label class="col-sm-3 control-label" style="width: 82px">老师获得</label>
                <div class="col-sm-2" style="width: 70px; padding: inherit">
                    <input name="teacherIncrease" th:field="*{teacherIncrease}" class="form-control" type="number" style="width: 50px" min="1">
                </div>
                <label class="control-label">课时</label>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">招生状态：</label>
                <div class="col-sm-7">
                    <select name="status" class="form-control" th:with="type=${@dict.getType('sys_classes_status')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开班日期：</label>
                <div class="col-sm-7">
                    <div class="input-group date">
                        <input name="startDate" th:value="${#dates.format(teachingClasses.startDate, 'yyyy-MM-dd')}" class="form-control" placeholder="选择日期" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结班日期：</label>
                <div class="col-sm-7">
                    <div class="input-group date">
                        <input name="endDate" th:value="${#dates.format(teachingClasses.endDate, 'yyyy-MM-dd')}" class="form-control" placeholder="选择日期" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>

<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">上课时间：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <div class="input-group date">-->
<!--                        <input name="teachTime" th:value="${#dates.format(teachingClasses.teachTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
<!--                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-7">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "teaching/classes";
        $("#form-classes-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                let data={
                    id:1,
                    name:"ss"
                };
                data.id=1;
                data.name="ss";

                $.operate.save(prefix + "/edit", $('#form-classes-edit').serialize());
            }
        }

        $("input[name='startDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='endDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='teachTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>